package com.dnndo.system.service.impl;

import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.parser.NodeParser;
import com.dnndo.system.domain.Menu;

public class MenuParserImpl implements NodeParser<Menu, Long> {
    @Override
    public void parse(Menu menu, Tree<Long> tree) {
        tree.setId(menu.getId());
        tree.setParentId(menu.getParentId());
        tree.setName(menu.getName());
        tree.putExtra("path", menu.getPath());
        tree.putExtra("redirect", menu.getRedirect());
        tree.putExtra("component", menu.getComponent());
        tree.putExtra("meta", menu.getMeta());
    }
}
